#ifndef TABLEDEFINE_H
#define TABLEDEFINE_H

//数据库连接名
#define MANAGEMENTDB_CONNECTION "management_connection"
#define PROJECTDB_CONNECTION "project_connection"
#define PRODUCT_CONNECTION "product_connection"

//表名
#define PM_TABLE_NAME "PM"
#define DM_TABLE_NAME "DM"
#define PRODUCT_INFO_TABLE_NAME "product_info"
#define BUILDING_TABLE_NAME "building"
#define DEVICE_TABLE_NAME "device"
#define INTERFACE_OBJECT_TABLE_NAME "interface_object"
#define COMM_OBJECT_TABLE_NAME "comm_object"
#define INTERFACE_COMM_OBJECT_RULE_TABLE_NAME "rules"
#define ADDRESS_TABLE_NAME "address"
#define RELATION_TABLE_NAME "relation"

//项目管理表字段
#define PROJECT_ID "project_id"
#define _PROJECT_ID ":project_id"
#define PROJECT_NAME "project_name"
#define _PROJECT_NAME ":project_name"
#define PROJECT_CREATE_DATE_TIME "create_date_time"
#define _PROJECT_CREATE_DATE_TIME ":create_date_time"
#define PROJECT_LAST_CHANGE_DATE_TIME "last_change_time"
#define _PROJECT_LAST_CHANGE_DATE_TIME ":last_change_time"
#define FLAG "flag"
#define _FLAG ":flag"

//设备管理表相关字段
#define PRODUCT_ID "product_id"
#define _PRODUCT_ID ":product_id"
#define MANUFACTURERS "manufacturers"
#define _MANUFACTURERS ":manufacturers"
#define ORDER_NUM "order_num"
#define _ORDER_NUM ":order_num"
#define MEDIUM_TYPE "medium_type"
#define _MEDIUM_TYPE ":medium_type"
#define APP_PROGRAM "app_program"
#define _APP_PROGRAM ":app_program"
#define VERSION "version"
#define _VERSION ":version"

//建筑表字段
#define BUILDING_ID "building_id"
#define _BUILDING_ID ":building_id"

//某些通用字段
#define ID "id"
#define _ID ":id"
#define NAME "name"
#define _NAME ":name"
#define DESCRIBE "describe"
#define _DESCRIBE ":describe"
#define NUM "num"
#define _NUM ":num"
#define UP_ID "up_id"
#define _UP_ID ":up_id"
#define TYPE "type"
#define _TYPE ":type"
#define ADDRESS "address"
#define _ADDRESS ":address"
#define VALUE "value"
#define _VALUE ":value"
#define EEPROM_ADDRESS "eeprom_address"
#define _EEPROM_ADDRESS ":eeprom_address"

//设备表字段
#define DEVICE_ID "device_id"
#define _DEVICE_ID ":device_id"
#define DEVICE_PA "PA"
#define _DEVICE_PA ":PA"
#define ADR "Adr"
#define _ADR ":Adr"
#define PRG "Prg"
#define _PRG ":Prg"
#define PAR "Par"
#define _PAR ":Par"
#define GRP "Grp"
#define _GRP ":Grp"
#define CFG "Cfg"
#define _CFG ":Cfg"
#define PRODUCT "product"
#define _PRODUCT ":product"
#define UNIT_TYPE "unit_type"
#define _UNIT_TYPE ":unit_type"
#define MANUFACTURERSDATA "manufacturesData"
#define _MANUFACTURERSDATA ":manufacturesData"
#define DEVICEDB_NAME "db_name"
#define _DEVICEDB_NAME ":db_name"
#define DEVICE_SN "SN"
#define _DEVICE_SN ":SN"

//接口对象表相关字段
#define INTERFACE_OBJECT_ID "interface_object_id"
#define _INTERFACE_OBJECT_ID ":interface_object_id"
#define CHANNEL_NUM "channel_num"
#define _CHANNEL_NUM ":channel_num"
#define CHANNEL_ID "channel_id"
#define _CHANNEL_ID ":channel_id"
#define CHANNEL_NAME "channel_name"
#define _CHANNEL_NAME ":channel_name"
#define CHANNEL_TYPE "channel_type"
#define _CHANNEL_TYPE ":channel_type"
#define INTERFACE_OBJECT_NUM "interface_object_num"
#define _INTERFACE_OBJECT_NUM ":interface_object_num"
#define INTERFACE_OBJECT_DESCRIBE "interface_object_describe"
#define _INTERFACE_OBJECT_DESCRIBE ":interface_object_describe"
#define VALUE_SET "value_set"
#define _VALUE_SET ":value_set"
#define VALUE_MEANING "value_meaning"
#define _VALUE_MEANING ":value_meaning"
#define DEFAULT_VALUE "default_value"
#define _DEFAULT_VALUE ":default_value"
#define VALUE "value"
#define _VALUE ":value"

//通讯对象表相关字段
#define COMM_OBJECT_ID "comm_object_id"
#define _COMM_OBJECT_ID ":comm_object_id"
#define COMM_OBJECT_NUM "comm_object_num"
#define _COMM_OBJECT_NUM ":comm_object_num"
#define FUNCTION "function"
#define _FUNCTION ":function"
#define C_BIT "C"
#define _C_BIT ":C"
#define R_BIT "R"
#define _R_BIT ":R"
#define W_BIT "W"
#define _W_BIT ":W"
#define V_BIT "V"
#define _V_BIT ":V"
#define T_BIT "T"
#define _T_BIT ":T"
#define U_BIT "U"
#define _U_BIT ":U"
#define DATA_TYPE "data_type"
#define _DATA_TYPE ":data_type"
#define PRIORITY "priority"
#define _PRIORITY ":priority"
#define RELATION_GA "relation_ga"
#define _RELATION_GA ":relation_ga"

//接口对象通讯对象规则id
#define RULE_ID "rule_id"
#define _RULE_ID ":rule_id"
#define RULE_TYPE "rule_type"
#define _RULE_TYPE ":rule_type"
#define INTERFACE_OBJECT_VALUE "interface_object_value"
#define _INTERFACE_OBJECT_VALUE ":interface_object_value"

//群组地址字段
#define ADDRESS_ID "address_id"
#define _ADDRESS_ID ":address_id"
#define ADDRESS_NUM "address_num"
#define _ADDRESS_NUM ":address_num"

//关联表相关字段
#define RELATION_ID "relation_id"
#define _RELATION_ID ":relation_id"
#define RELATION_NUM "relation_num"
#define _RELATION_NUM ":relation_num"

#endif // TABLEDEFINE_H
